<?php
use common\service\UserService;
use admin\assets\AppAsset;
AppAsset::addJs($this,'/static/js/user/detail.js');
?>

<form class="layui-form layui-form-pane" style="padding:20px;">

    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
        <legend>用户基本信息</legend>
    </fieldset>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">姓名</label>
            <div class="layui-input-inline">
                <input type="hidden" name="id" value="<?php echo $user['id']; ?>">
                <input type="text" name="name" value="<?php echo $user['name']; ?>" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">性别</label>
            <div class="layui-input-inline">
                <input type="text" name="sex" disabled value="<?php echo $user['sex']; ?>" autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-inline">
                <select name="status">
                    <option value="1" <?php if($user['status']==1){echo 'selected';} ?> ><?php echo UserService::getStatusText(1); ?></option>
                    <option value="2" <?php if($user['status']==2){echo 'selected';} ?> ><?php echo UserService::getStatusText(2); ?></option>
                    <option value="3" <?php if($user['status']==3){echo 'selected';} ?> ><?php echo UserService::getStatusText(3); ?></option>
                    <option value="4" <?php if($user['status']==4){echo 'selected';} ?> ><?php echo UserService::getStatusText(4); ?></option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">注册时间</label>
            <div class="layui-input-inline">
                <input type="text" name="register_time" disabled value="<?php echo date('Y-m-d H:i:s',$user['register_time']); ?>" autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">国籍</label>
            <div class="layui-input-inline">
                <input type="text" name="country" disabled value="<?php echo $user['country']; ?>" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">证件</label>
            <div class="layui-input-inline">
                <input type="text" name="card_type" disabled value="<?php echo $user['card_type']; ?>" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">证件号码</label>
            <div class="layui-input-inline">
                <input type="text" name="card_code" disabled value="<?php echo $user['card_code']; ?>" autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">手机</label>
            <div class="layui-input-inline">
                <input type="text" name="phone" disabled value="<?php echo $user['phone']; ?>" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">QQ号</label>
            <div class="layui-input-inline">
                <input type="text" name="qq" value="<?php echo $user['qq']; ?>" autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">联系地址</label>
        <div class="layui-input-block">
            <input type="text" style="width:860px;" value="<?php echo $user['address']; ?>" name="address" autocomplete="off" class="layui-input">
        </div>
    </div>

    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
        <legend>客户类型</legend>
    </fieldset>
    <div class="layui-inline">
        <label class="layui-form-label">客户类型</label>
        <div class="layui-input-inline">
            <select name="account_type">
                <option value="1" <?php if($user['account_type']==1){echo 'selected';} ?> > 客户 </option>
                <option value="2" <?php if($user['account_type']==2){echo 'selected';} ?> > 门店 </option>
                <option value="3" <?php if($user['account_type']==3){echo 'selected';} ?> > 县级代理 </option>
                <option value="4" <?php if($user['account_type']==4){echo 'selected';} ?> > 市级代理 </option>
<!--                <option value="5" --><?php //if($user['account_type']==5){echo 'selected';} ?><!-- >--><?php //echo UserService::getStatusText(3); ?><!--</option>-->
            </select>
        </div>
    </div>


    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
        <legend><?php echo WEB_TITLE; ?>交易账户</legend>
    </fieldset>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">交易商编号</label>
            <div class="layui-input-inline">
                <input type="text" name="firm_id"  value="<?php echo $firm['FIRMID']; ?>" autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>

    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
        <legend>推荐人</legend>
    </fieldset>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">推荐人</label>
            <div class="layui-input-inline">
                <select <?php if($user['int_id']>0){echo 'disabled';} ?> name="int_id" lay-search="">
                    <option value="">--请选择--</option>
                    <?php foreach($int_users as $key=>$val): ?>
                    <option value="<?php echo $val['id']; ?>" <?php if($user['int_id']==$val['id']){echo 'selected';} ?> ><?php echo $val['phone'].' ('.$val['name'].') '; ?></option>
                    <?php endforeach; ?>
                </select>
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <button type="button" class="layui-btn" lay-submit="" lay-filter="submit_btn">保存</button>
    </div>

</form>